/**
 * Or.java	1.0 2007 六月 1 16:48:03,创建
 */

package org.in4j.search.query;

import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;

/**
 *
 * @author 杨帆
 * @version 1.0 2007 六月 1 16:48:03,创建
 */
public class Or implements IQuery
{
	private final IQuery query1;
	private final IQuery query2;

	public Or(IQuery query1,IQuery query2)
	{
		this.query1 = query1;
		this.query2 = query2;
	}

	public Query getQuery()
	{
		BooleanQuery booleanQuery = new BooleanQuery();
		booleanQuery.add(query1.getQuery(), BooleanClause.Occur.SHOULD);
		booleanQuery.add(query2.getQuery(), BooleanClause.Occur.SHOULD);
		return booleanQuery;
	}
}
